<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.hide{
			display: none;
		}
		.show{
			display: block;
		}
		#img1{
			cursor: pointer;
		}

	</style>
</head>
<body>
	<div class="box">
		<img src="../image/4.png" alt="" id="img1">
		<img src="../image/456.png" alt="" class="hide" id="img2">
	</div>


	<script>

		var img1Obj = document.getElementById('img1')
		var img2Obj = document.getElementById('img2')
		img1Obj.onmouseenter = function(){
			img2Obj.className = "show"
		}
		img1Obj.onmouseleave = function(){
			img2Obj.className = "hide"
		}

	</script>
</body>
</html>